/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.fd.manager.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xy.biz.fd.domain.bo.DocumentFavoriteBO;
import com.xy.biz.fd.domain.query.DocumentFavoriteQuery;
import com.xy.biz.fd.domain.converter.DocumentFavoriteConverter;
import com.xy.biz.fd.manager.DocumentFavoriteManager;
import com.xy.biz.fd.dao.DocumentFavoriteDao;

/**
 *
 *
 * @author wwj
 * @date 2021-2-2
 */
@Service
public class DocumentFavoriteManagerImpl implements DocumentFavoriteManager {

	@Autowired
	private DocumentFavoriteDao documentFavoriteDao;

	@Override
	public int saveDocumentFavorite(DocumentFavoriteBO documentFavoriteBO) {
		return documentFavoriteDao.saveDocumentFavorite(DocumentFavoriteConverter.toPO(documentFavoriteBO));
	}

	@Override
	public int saveAllDocumentFavorite(Collection<DocumentFavoriteBO> collection) {
		return documentFavoriteDao.saveAllDocumentFavorite(DocumentFavoriteConverter.toPO(collection));
	}

	@Override
	public int updateDocumentFavorite(DocumentFavoriteBO documentFavoriteBO) {
		return documentFavoriteDao.updateDocumentFavorite(DocumentFavoriteConverter.toPO(documentFavoriteBO));
	}

	@Override
	public int updateDocumentFavoritesByIds(Collection<Long> ids) {
		return documentFavoriteDao.updateDocumentFavoritesByIds(ids);
	}

	@Override
	public int deleteDocumentFavorite(Long documentFavoriteId) {
		return documentFavoriteDao.deleteDocumentFavorite(documentFavoriteId);
	}

	@Override
	public DocumentFavoriteBO getDocumentFavorite(Long documentFavoriteId) {
		return DocumentFavoriteConverter.fromPO(documentFavoriteDao.getDocumentFavorite(documentFavoriteId));
	}

	@Override
	public DocumentFavoriteBO getDocumentId(DocumentFavoriteQuery query) {
		return DocumentFavoriteConverter.fromPO(documentFavoriteDao.getDocumentId(query));
	}

	@Override
	public List<DocumentFavoriteBO> listDocumentFavoriteById(Collection<Long> collection) {
		return DocumentFavoriteConverter.fromPO(documentFavoriteDao.listDocumentFavoriteById(collection));
	}

	@Override
	public List<DocumentFavoriteBO> listDocumentFavorite(DocumentFavoriteQuery query) {
		return DocumentFavoriteConverter.fromPO(documentFavoriteDao.listDocumentFavorite(query));
	}

	@Override
	public int countDocumentFavorite(DocumentFavoriteQuery query) {
		return documentFavoriteDao.countDocumentFavorite(query);
	}

	@Override
	public int deleteListDocumentFavorite(Collection<Long> documentFavoriteIds) {
		return documentFavoriteDao.deleteListDocumentFavorite(documentFavoriteIds);
	}

}
